package cn.com.bluemoon.daps.model.core.file.entry;

import cn.com.bluemoon.daps.common.domain.ResultBean;

import java.util.List;

public interface ResultEntry<T> {
    public ResultBean<Boolean> entry(T entryModel);

    public default ResultBean<Boolean> entry(List<T> entryModels) {
        for (T entryModel : entryModels) {
            ResultBean<Boolean> entry = entry(entryModel);
            if (entry.getCode() != 200) {
                return entry;
            }
        }
        return ResultBean.ok(true);
    }


}
